#include "ejcommon.h"
#include <QHeaderView>


QTableWidget * CreateQTableWidget(QWidget *parent, QStringList &list)
{
    int columns = list.size();

    auto table = new QTableWidget(0, columns, parent);
    table->setSelectionMode(QAbstractItemView::ExtendedSelection); /*设置可多选*/
    table->setSelectionBehavior(QAbstractItemView::SelectRows);    /*设置整行选择*/
    table->setHorizontalHeaderLabels(list);                        /*设置表头*/
    //table->setEditTriggers(QAbstractItemView::NoEditTriggers);     /*将表格变为禁止编辑*/
    table->verticalHeader()->setVisible(false);                    /*设置垂直表头不可见*/
    table->setFrameShape(QFrame::NoFrame);                         /*设置没有边框*/

    return table;
}
